package com.os;

import com.os.pojo.vo.ActionVo;
import com.os.service.OsService;
import com.os.service.impl.OsServiceImpl;
import com.os.utils.FileUtils;

import java.util.*;

/**
 * @author xyongfeng
 */
public class Main {
    public static OsService osService = new OsServiceImpl();


    public static void main(String[] args) throws Exception {
        // 必须放在主文件获取
        FileUtils.getPathOfRes("config.yaml");

        for (int i = 0; i < 3; i++) {
            osService.open(FileUtils.getPathOfRes("1.txt"));
        }

//        osService.open("D:\\5-四合天地人工智能实训系统使用手册.pdf");

        List<Integer> logicAddress = osService.getLogicAddress(0, 3, null, null);


//        osService.changeSwapAlgorithm(SwapContent.FIFO);
//        osService.shuttleList(logicAddress);
//        System.out.println(logicAddress);

        logicAddress = Arrays.asList(1,2,3,4,128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142,200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 192, 193, 194, 195, 196, 197, 198, 199);
//        logicAddress = Arrays.asL
//        ist( 0, 49, 562, 51, 777, 803, 289, 2, 1096, 40, 297, 1353, 57, 1089, 19, 512, 1330, 33, 1042, 304, 1328, 1283, 793, 25, 1321, 299, 547, 1312, 264, 281, 778, 1090, 1339, 528, 10, 529, 258, 1299, 577, 1331, 43, 522, 818, 513, 536, 313, 787, 810, 9, 274, 514, 1280, 568, 1347, 578, 1081, 1074, 1040, 1050, 1337, 1322, 800, 817, 1072, 769, 272, 288, 1067, 537, 56, 552, 1083, 24, 1290, 555, 3, 306, 323, 786, 296, 816, 35, 795, 563, 576, 561, 1088, 283, 570, 771, 1336, 571, 768, 26, 1306, 280, 770, 1346, 1305, 539, 1033, 1281, 1064, 1026, 1051, 776, 553, 523, 1282, 273, 521, 585, 531, 1352, 1066, 546, 1059, 544, 1297, 314, 833, 1024, 1034, 1048, 282, 801, 50, 785, 1032, 1307, 321, 1, 808, 312, 1027, 835, 290, 1304, 1080, 8, 826, 1291, 322, 27, 579, 1288, 291, 1091, 257, 832, 266, 32, 1296, 16, 809, 1313, 1073, 825, 538, 779, 515, 320, 1058, 1075, 315, 328, 840, 275, 1057, 560, 1082, 1314, 802, 1329, 307, 1065, 1289, 267, 784, 1035, 298, 1025, 794, 41, 34, 520, 18, 42, 265, 792, 819, 545, 11, 48, 1315, 1056, 530, 256, 584, 1320, 1345, 1298, 1338, 259, 811, 1041, 1344, 1043, 17, 824, 569, 305, 827, 1049, 834, 554);


        System.out.println(osService.getValueByAddressList(0, logicAddress));
        System.out.println(osService.getValueByAddressList(0, logicAddress));


        List<ActionVo> actionList = osService.getActionList();

//        System.out.println(osService.countAlgorithm(0, logicAddress));


    }
}
